﻿#include "zuhechaxun.h"
#include "ui_zuhechaxun.h"
#include <QDebug>
#include <QSqlQuery>
#include <QTextCodec>
#include <QMessageBox>

Form2::Form2(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Form2)
{
    ui->setupUi(this);
    QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF8"));
    QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF8"));
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF8"));
    //ui.scrollAreaWidgetContents->adjustSize();
    //connect(ui->treeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), ui->treeWidget_2, SLOT(slotDoubleClickItem(QTreeWidgetItem *, int)));
    connect(ui->treeWidget_2,SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),this,SLOT(showSelectedImage(QTreeWidgetItem*,int)));
    //时间设置
    ui->renzhis->setDisplayFormat("yyyy-MM-dd");//设置输出格式 ; 开始时间格式为2000-01-01 样式
    ui->renzhis->setCalendarPopup(true);
    ui->renzhie->setDisplayFormat("yyyy-MM-dd");//设置输出格式 ; 开始时间格式为2000-01-01 样式
    ui->renzhie->setCalendarPopup(true);
    ui->births->setDisplayFormat("yyyy-MM-dd");//设置输出格式 ; 开始时间格式为2000-01-01 样式
    ui->births->setCalendarPopup(true);
    ui->birthe->setDisplayFormat("yyyy-MM-dd");//设置输出格式 ; 开始时间格式为2000-01-01 样式
    ui->birthe->setCalendarPopup(true);
    ui->daiyus->setDisplayFormat("yyyy-MM-dd");//设置输出格式 ; 开始时间格式为2000-01-01 样式
    ui->daiyus->setCalendarPopup(true);
    ui->daiyue->setDisplayFormat("yyyy-MM-dd");//设置输出格式 ; 开始时间格式为2000-01-01 样式
    ui->daiyue->setCalendarPopup(true);
    ui->rudangs->setDisplayFormat("yyyy-MM-dd");//设置输出格式 ; 开始时间格式为2000-01-01 样式
    ui->rudangs->setCalendarPopup(true);
    ui->rudange->setDisplayFormat("yyyy-MM-dd");//设置输出格式 ; 开始时间格式为2000-01-01 样式
    ui->rudange->setCalendarPopup(true);
    ui->joinworks->setDisplayFormat("yyyy-MM-dd");//设置输出格式 ; 开始时间格式为2000-01-01 样式
    ui->joinworks->setCalendarPopup(true);
    ui->joinworke->setDisplayFormat("yyyy-MM-dd");//设置输出格式 ; 开始时间格式为2000-01-01 样式
    ui->joinworke->setCalendarPopup(true);

    ui->jiguanall->setFocusPolicy(Qt::NoFocus);
    ui->growplace->setFocusPolicy(Qt::NoFocus);
    ui->birthplace->setFocusPolicy(Qt::NoFocus);


    QSqlQuery selectjiguan;
    selectjiguan.exec("select * from AdminAreaCode");
    while (selectjiguan.next()){
        QString alljiguanID=selectjiguan.value(0).toString();//籍贯代码
        QString alljiguan=selectjiguan.value(1).toString();

        QString ooxxxx=alljiguanID.mid(2,4);//后四位
        if(ooxxxx=="0000"){//后四位为0000，表示省份或自治区或直辖市
            ui->jiguansheng->addItem(alljiguan);
        }
    }
    QSqlQuery selectbirth;
    selectbirth.exec("select * from AdminAreaCode");
    while (selectbirth.next()){
        QString alljiguanID=selectbirth.value(0).toString();//籍贯代码
        QString alljiguan=selectbirth.value(1).toString();

        QString ooxxxx=alljiguanID.mid(2,4);//后四位
        if(ooxxxx=="0000"){//后四位为0000，表示省份或自治区或直辖市
            ui->birthsheng->addItem(alljiguan);
        }
    }
    QSqlQuery selectgrow;
    selectgrow.exec("select * from AdminAreaCode");
    while (selectgrow.next()){
        QString alljiguanID=selectgrow.value(0).toString();//籍贯代码
        QString alljiguan=selectgrow.value(1).toString();

        QString ooxxxx=alljiguanID.mid(2,4);//后四位
        if(ooxxxx=="0000"){//后四位为0000，表示省份或自治区或直辖市
            ui->growsheng->addItem(alljiguan);
        }
    }

    connect(ui->jiguansheng,SIGNAL(currentIndexChanged(QString)),this,SLOT(printshi()));
    connect(ui->jiguanshi,SIGNAL(currentIndexChanged(QString)),this,SLOT(printqu()));
    connect(ui->birthsheng,SIGNAL(currentIndexChanged(QString)),this,SLOT(printbirthshi()));
    connect(ui->birthshi,SIGNAL(currentIndexChanged(QString)),this,SLOT(printbirthqu()));
    connect(ui->growsheng,SIGNAL(currentIndexChanged(QString)),this,SLOT(printgrowshi()));
    connect(ui->growshi,SIGNAL(currentIndexChanged(QString)),this,SLOT(printgrowqu()));



}
Form2::~Form2()
{
    delete ui;
}

void Form2::printbirthshi(){
    ui->birthshi->clear();
    ui->birthshi->addItem("市");
    QString sheng=ui->birthsheng->currentText();
    int shengnamenum=sheng.length();
    QSqlQuery selectsheng;
    QSqlQuery selectall;
    selectsheng.exec(QString("select * from AdminAreaCode where AdminArea='%1'").arg(sheng));
    while(selectsheng.next()){
        QString shengid=selectsheng.value(0).toString();
        QString xxoooo=shengid.mid(0,2);//前两位
        selectall.exec("select * from AdminAreaCode");
        while(selectall.next()){
            QString all=selectall.value(0).toString();
            QString allname=selectall.value(1).toString();
            int shinamenum=allname.length();
            allname=allname.mid(shengnamenum,shinamenum-shengnamenum);
            if(all.mid(0,2)==xxoooo && all.mid(4,2)=="00" &&all.mid(2,2)!="00"){
                ui->birthshi->addItem(allname);
            }
        }
    }

}
void Form2::printbirthqu(){
    ui->birthqu->clear();
    ui->birthqu->addItem("区");
    QString sheng=ui->birthsheng->currentText();
    int shengnum=sheng.length();
    QString shi=ui->birthshi->currentText();
    QString all=sheng+shi;
    QSqlQuery shengshi;
    QSqlQuery selectall;

    shengshi.exec(QString("select * from AdminAreaCode where AdminArea='%1'").arg(all));
    while(shengshi.next()){
        QString id=shengshi.value(0).toString();//xxxxoo
        selectall.exec("select * from AdminAreaCode");
        while(selectall.next()){
            QString allid=selectall.value(0).toString();
            QString allname=selectall.value(1).toString();
            int allnamenum=allname.length();
            if(allid.mid(0,4)==id.mid(0,4) && allid.mid(4,2) != "00"){
                ui->birthqu->addItem(allname.mid(shengnum,allnamenum-shengnum));
            }
        }
    }
}
void Form2::printgrowshi(){
    ui->growshi->clear();
    ui->growshi->addItem("市");
    QString sheng=ui->growsheng->currentText();
    int shengnamenum=sheng.length();
    QSqlQuery selectsheng;
    QSqlQuery selectall;
    selectsheng.exec(QString("select * from AdminAreaCode where AdminArea='%1'").arg(sheng));
    while(selectsheng.next()){
        QString shengid=selectsheng.value(0).toString();
        QString xxoooo=shengid.mid(0,2);//前两位
        selectall.exec("select * from AdminAreaCode");
        while(selectall.next()){
            QString all=selectall.value(0).toString();
            QString allname=selectall.value(1).toString();
            int shinamenum=allname.length();
            allname=allname.mid(shengnamenum,shinamenum-shengnamenum);
            if(all.mid(0,2)==xxoooo && all.mid(4,2)=="00" &&all.mid(2,2)!="00"){
                ui->growshi->addItem(allname);
            }
        }
    }

}
void Form2::printgrowqu(){
    ui->growqu->clear();
    ui->growqu->addItem("区");
    QString sheng=ui->growsheng->currentText();
    int shengnum=sheng.length();
    QString shi=ui->growshi->currentText();
    QString all=sheng+shi;
    QSqlQuery shengshi;
    QSqlQuery selectall;

    shengshi.exec(QString("select * from AdminAreaCode where AdminArea='%1'").arg(all));
    while(shengshi.next()){
        QString id=shengshi.value(0).toString();//xxxxoo
        selectall.exec("select * from AdminAreaCode");
        while(selectall.next()){
            QString allid=selectall.value(0).toString();
            QString allname=selectall.value(1).toString();
            int allnamenum=allname.length();
            if(allid.mid(0,4)==id.mid(0,4) && allid.mid(4,2) != "00"){
                ui->growqu->addItem(allname.mid(shengnum,allnamenum-shengnum));
            }
        }
    }
}






void Form2::printshi(){
    ui->jiguanshi->clear();
    ui->jiguanshi->addItem("市");
    QString sheng=ui->jiguansheng->currentText();
    int shengnamenum=sheng.length();
    QSqlQuery selectsheng;
    QSqlQuery selectall;
    selectsheng.exec(QString("select * from AdminAreaCode where AdminArea='%1'").arg(sheng));
    while(selectsheng.next()){
        QString shengid=selectsheng.value(0).toString();
        QString xxoooo=shengid.mid(0,2);//前两位
        selectall.exec("select * from AdminAreaCode");
        while(selectall.next()){
            QString all=selectall.value(0).toString();
            QString allname=selectall.value(1).toString();
            int shinamenum=allname.length();
            allname=allname.mid(shengnamenum,shinamenum-shengnamenum);
            if(all.mid(0,2)==xxoooo && all.mid(4,2)=="00" &&all.mid(2,2)!="00"){
                ui->jiguanshi->addItem(allname);
            }
        }
    }


}

void Form2::printqu(){

    ui->jiguanqu->clear();
    ui->jiguanqu->addItem("区");
    QString sheng=ui->jiguansheng->currentText();
    int shengnum=sheng.length();
    QString shi=ui->jiguanshi->currentText();
    QString all=sheng+shi;
    QSqlQuery shengshi;
    QSqlQuery selectall;

    shengshi.exec(QString("select * from AdminAreaCode where AdminArea='%1'").arg(all));
    while(shengshi.next()){
        QString id=shengshi.value(0).toString();//xxxxoo
        selectall.exec("select * from AdminAreaCode");
        while(selectall.next()){
            QString allid=selectall.value(0).toString();
            QString allname=selectall.value(1).toString();
            int allnamenum=allname.length();
            if(allid.mid(0,4)==id.mid(0,4) && allid.mid(4,2) != "00"){
                ui->jiguanqu->addItem(allname.mid(shengnum,allnamenum-shengnum));
            }
        }
    }


}

//void Form2::slotDoubleClickItem(QTreeWidgetItem *item, int col)
//{
// 从item中获得QString text()或者QVariant data()
// QTreeWidgetItem *parent=item->parent();//获得父节点
// if(NULL==parent)
//     return;
//progessBar->setValue(0);//进度条置0
//int row=parent->indexOfChild(item);//获得节点在父节点中的行号(从0开始)
//QString text=parent->text(0);//获得父节点的文本字符(即影像路径)
//qDebug()<<text;
//qDebug()<<row;
/* QString->const char* */
// QByteArray ba=fileName.toLocal8Bit();
//const char* filePath=ba.data();
//QVariant data();
// QString text();

//}

//void Form2::on_treeWidget_doubleClicked(const QModelIndex &index)
//{

// QModelIndex index1=ui->treeWidget->itemFromIndex(index);
//qDebug()<<"row"<<index.topLevelItem();
//qDebug()<<"cloumn"<<index.column();
// 从item中获得QString text()或者QVariant data()
// QTreeWidgetItem *parent=item->parent();//获得父节点
// if(NULL==parent)
//     return;
//progessBar->setValue(0);//进度条置0
// int row=parent->indexOfChild(item);//获得节点在父节点中的行号(从0开始)
// QString text=parent->text(0);//获得父节点的文本字符(即影像路径)
//qDebug()<<text;
// qDebug()<<row;


//    const bool __sortingEnabled = treeWidget->isSortingEnabled();
//    treeWidget->setSortingEnabled(false);
//   QTreeWidgetItem *___qtreewidgetitem = treeWidget->topLevelItem(0);

// QTreeWidgetItem *___qtreewidgetitem1 = ___qtreewidgetitem->child(0);

//QTreeWidgetItem *___qtreewidgetitem2 = ___qtreewidgetitem->child(1);

//QTreeWidgetItem *___qtreewidgetitem3 = treeWidget->topLevelItem(1);

//    QTreeWidgetItem *___qtreewidgetitem4 = ___qtreewidgetitem3->child(0);

//    QTreeWidgetItem *___qtreewidgetitem5 = ___qtreewidgetitem3->child(1);

//    QTreeWidgetItem *___qtreewidgetitem6 = ___qtreewidgetitem3->child(2);

// QTreeWidgetItem *___qtreewidgetitem7 = treeWidget->topLevelItem(2);

//    QTreeWidgetItem *___qtreewidgetitem8 = ___qtreewidgetitem7->child(0);

//    QTreeWidgetItem *___qtreewidgetitem9 = ___qtreewidgetitem7->child(1);

//    treeWidget->setSortingEnabled(__sortingEnabled);


//}


void Form2::showSelectedImage(QTreeWidgetItem *item, int column)
{
    QTreeWidgetItem * currentItem = ui->treeWidget_2->currentItem();
    QTreeWidgetItem *parent = item->parent();
    //QTreeWidgetItem *parent = currentItem->parent();
    if(NULL==parent) //注意：最顶端项是没有父节点的，双击这些项时注意(陷阱)
        return;
    int col =parent->indexOfChild(item); //item在父项中的节点行号(从0开始)

    if(0==col) //Band1
    {
        qDebug()<<"1";
        qDebug()<<column;
        //delete ui->treeWidget_2->takeTopLevelItem(ui->treeWidget_2->currentIndex().row());//删除全部节点
        //delete ui->treeWidget_2->currentItem->parent()->takeChild(ui->treeWidget_2->currentIndex().row());
        delete currentItem->parent()->takeChild(ui->treeWidget_2->currentIndex().row());//删除当前节点
    }
    if(1==col) //Band2
    {
        qDebug()<<"2";
        qDebug()<<column;
        //delete ui->treeWidget_2->currentItem->parent->takeChild(ui->treeWidget_2->currentIndex().row());
        delete currentItem->parent()->takeChild(ui->treeWidget_2->currentIndex().row());//删除当前节点
    }
}

void Form2::on_pushButton_clicked()//连接重名干部信号槽
{
    same=new samename();
    connect(same,SIGNAL(sendData1(QString)),this,SLOT(recvData1(QString)));

    if(same->exec()==QDialog::Accepted){
    }
    delete same;
    //    same->show();


}

void Form2::recvData1(QString id)//接收重名干部
{
    emit sendData2(id);
}

void Form2::on_pushButton_3_clicked()//发送一个根据条件查询后的干部IDNum
{
    //    //年龄查询
    //    //当前时间的年份-最小年龄=出生年份的上限
    //    //当前时间的年份-最大年龄=出生年份的
    //    //下限<出生年份<上限
    //    QDate year;
    //    QDateTime current_date_time =QDateTime::currentDateTime();
    //    QString current_date =current_date_time.toString("yyyy");
    //    //    qDebug()<<current_date;
    //    int date = current_date.toInt();
    //    oldmax=ui->oldmax->text();//最大年龄
    //    oldmin=ui->oldmin->text();//最小年龄
    //    if(oldmax!="NULL"|| oldmin!="NULL"){
    //        int oldbig=oldmax.toInt();
    //        int oldsmall=oldmin.toInt();
    //        int minyear=date-oldbig;
    //        int maxyear=date-oldsmall;
    //        selectbirthtime2.exec("select Birth,IDNum from CadreInfo ");
    //        while(selectbirthtime2.next()){
    //            year=selectbirthtime2.value(0).toDate();
    //            iddate=selectbirthtime2.value(1).toString();
    //            int y=year.year();
    //            if(y<maxyear || y>minyear){
    //                emit sendData3(iddate);//发送查询的干部IDNum
    //                this->close();
    //            }
    //        }
    //    }
    QString id="NULL";

    QString judgeall;
    QString name;
    bool namenotempty=!ui->name->text().isEmpty();
    QString unit;
    bool unitnotempty=!ui->unit->text().isEmpty();
    QString zhiwu;
    bool zhiwunotempty=!ui->zhiwu->text().isEmpty();
    QString schooledu;
    bool schooledunotempty=!ui->schooledu->text().isEmpty();
    QString workedu;
    bool workedunotempty=!ui->workedu->text().isEmpty();
    QString birthplace;
    bool birthplacenotempyt=!ui->birthplace->text().isEmpty();
    QString growplace;
    bool growplacenotempyt=!ui->growplace->text().isEmpty();
    QString jiguanall;
    bool jiguanallnotempyt=!ui->jiguanall->text().isEmpty();
    QString birth;
    QString births=ui->births->text();                       //出生日期start
    QString birthe=ui->birthe->text();                       //出生日期end

    QString joinworktime;
    QString joinworks=ui->joinworks->text();
    QString joinworke=ui->joinworke->text();

    QString rudangtime;
    QString rudangs=ui->rudangs->text();
    QString rudange=ui->rudange->text();

    QString renzhitime;
    QString renzhis=ui->renzhis->text();
    QString renzhie=ui->renzhie->text();



    //当前时间的年份-年龄的大小:有问题
    int oldmin=-ui->oldmin->text().toInt();
    int oldmax=-ui->oldmax->text().toInt();
    QDate now=QDate::currentDate();
    QDate min=now.addYears(oldmax);//60
    QDate max=now.addYears(oldmin);
    QString minyear=min.toString("yyyy-MM-dd");//1960-04-27 qDebug
    QString maxyear=max.toString("yyyy-MM-dd");
    QString old;

    QSqlQuery selectall;
    QSqlQuery changejiguan;

    judgeall=QString("select distinct c.IDNum from CadreInfo c,unit u,Post p,Edu e where c.IDNum=p.IDNum and c.IDNum=e.IDNum and c.UnitID=u.unitid ");



    QString status;//干部状态
    QString threeone; //三龄一历

    if(ui->ischeckBox->isChecked()&&!ui->notcheckBox->isChecked()){
        threeone=" AND c.ThreeOne='0'";
    }
    if(ui->notcheckBox->isChecked()&&!ui->ischeckBox->isChecked()){
        threeone=" AND c.ThreeOne='1'";
    }


    if(ui->zaizhicheckBox->isChecked()&&!ui->lituicheckBox->isChecked()&&!ui->others->isChecked()){
        status=QString(" AND c.ManageStatusID='%1' ").arg("1");//在职
    }
    if(ui->lituicheckBox->isChecked()&&!ui->others->isChecked()&&!ui->zaizhicheckBox->isChecked()){
        status=QString(" AND c.ManageStatusID='%1' ").arg("2");//离退
    }
    if(ui->others->isChecked()&&!ui->zaizhicheckBox->isChecked()&&!ui->lituicheckBox->isChecked()){
        status=QString(" AND c.ManageStatusID='%1' ").arg("9");//其他
    }
    //选三个
    if(ui->zaizhicheckBox->isChecked()&&ui->lituicheckBox->isChecked()&&ui->others->isChecked()){
        status=" AND (c.ManageStatusID='1' or c.ManageStatusID='2' or c.ManageStatusID='9')";
    }
    //选两个
    if(ui->zaizhicheckBox->isChecked()&&ui->lituicheckBox->isChecked()&&!ui->others->isChecked()){
        status=" AND (c.ManageStatusID='1' or c.ManageStatusID='2')";
    }
    if(ui->zaizhicheckBox->isChecked()&&!ui->lituicheckBox->isChecked()&&ui->others->isChecked()){
        status=" AND (c.ManageStatusID='1' or c.ManageStatusID='9')";
    }
    if(!ui->zaizhicheckBox->isChecked()&&ui->lituicheckBox->isChecked()&&ui->others->isChecked()){
        status=" AND (c.ManageStatusID='9' or c.ManageStatusID='2')";
    }







    if(unitnotempty){
        unit=QString(" AND u.unitname='%1'").arg(ui->unit->text());
    }
    if(zhiwunotempty){
        zhiwu=QString(" and p.PostName='%1' ").arg(ui->zhiwu->text());
    }
    if(namenotempty){
        name=QString(" AND c.CadreName='%1' ").arg(ui->name->text());
    }

    //专业表二选一
    if(schooledunotempty){
        schooledu=QString(" AND e.Major='%1' and e.WorkORSchool=1 ").arg(ui->schooledu->text());
    }
    if(workedunotempty){
        workedu=QString(" AND e.Major='%1' and e.WorkORSchool=0 ").arg(ui->workedu->text());
    }

    if(jiguanallnotempyt){
        QString jiguancode;
        changejiguan.exec(QString("select AdminAreaID from AdminAreaCode where AdminArea='%1'").arg(ui->jiguanall->text()));
        while(changejiguan.next()){
            jiguancode=changejiguan.value(0).toString();
        }

        jiguanall=QString(" AND c.NativePlace='%1' ").arg(jiguancode);
    }

    if(growplacenotempyt){
        growplace=QString(" AND c.GrowPlace='%1' ").arg(ui->growplace->text());
    }

    if(birthplacenotempyt){
        birthplace=QString(" AND c.BirthPlace='%1' ").arg(ui->birthplace->text());
    }
    birth=QString(" and c.Birth>'%1' and c.Birth<'%2'").arg(births).arg(birthe);
    joinworktime=QString(" and c.JoinWorkTime>'%1' and c.JoinWorkTime<'%2'").arg(joinworks).arg(joinworke);
    rudangtime=QString(" and c.PartyTime>'%1' and c.PartyTime<'%2'").arg(rudangs).arg(rudange);
    renzhitime=QString(" and p.PostTime>'%1' and p.PostTime<'%2' and p.QualifyType=0").arg(renzhis).arg(renzhie);

    //    old=QString(" and c.Birth>'%1' and c.Birth<'%2'").arg(minyear).arg(maxyear);
    //c.IDNum=e.IDNum and p.IDNum=e.IDNum p.IDNum=c.IDNum
    //    judgeall=QString("select c.IDNum from CadreInfo c,unit u,Post p,Edu e where c.IDNum=e.IDNum and c.UnitID=u.unitid and p.IDNum=c.IDNum and c.IDNum=12"    );

    judgeall=judgeall+zhiwu+name+unit+workedu+schooledu+jiguanall+birth+old+joinworktime+rudangtime+renzhitime+birthplace+growplace+status+threeone;

    qDebug()<<judgeall;

    selectall.exec(judgeall);
    while(selectall.next()){
        id=selectall.value(0).toString();
        qDebug()<<id;
        emit sendData3(id);//发送查询的干部IDNum
        this->close();
    }
    if(id=="NULL"){
        QMessageBox::information(this, tr("提示信息"), tr("系统中未找到查询干部的信息"));
    }
}

void Form2::on_jiguanqu_currentIndexChanged(const QString &arg1)//写入籍贯信息
{
    QString sheng=ui->jiguansheng->currentText();
    ui->jiguanall->setText(sheng+arg1);
}



void Form2::on_birthqu_currentIndexChanged(const QString &arg1)
{
    QString sheng=ui->birthsheng->currentText();
    ui->birthplace->setText(sheng+arg1);
}

void Form2::on_growqu_currentIndexChanged(const QString &arg1)
{
    QString sheng=ui->growsheng->currentText();
    ui->growplace->setText(sheng+arg1);
}

void Form2::on_oldmin_textChanged(const QString &arg1)
{
    int oldmin=-arg1.toInt();

    QDate now=QDate::currentDate();

    QDate max=now.addYears(oldmin);

    ui->birthe->setDate(max);
}

void Form2::on_oldmax_textChanged(const QString &arg1)
{
    int oldmax=-arg1.toInt();

    QDate now=QDate::currentDate();

    QDate min=now.addYears(oldmax);

    ui->births->setDate(min);
}

void Form2::on_renzhimin_textChanged(const QString &arg1)
{
    int renzhimin=-arg1.toInt();

    QDate now=QDate::currentDate();

    QDate max=now.addYears(renzhimin);

    ui->renzhie->setDate(max);
}

void Form2::on_renzhimax_textChanged(const QString &arg1)
{
    int renzhimax=-arg1.toInt();

    QDate now=QDate::currentDate();

    QDate min=now.addYears(renzhimax);

    ui->renzhis->setDate(min);
    }
